<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <script src="jquery.js" charset="utf-8"></script>
    <script>
    let p=new Promise((resolve, reject)=>{
      //resolve       解决->成功
      //reject        拒绝->失败

      $.ajax({
        url: '1.txt',
        dataType: 'json',
        success(json){
          resolve(json);
        },
        error(err){
          reject(err);
        }
      });
    });

    let p2=new Promise((resolve, reject)=>{
      //resolve       解决->成功
      //reject        拒绝->失败

      $.ajax({
        url: '2.txt',
        dataType: 'json',
        success(json){
          resolve(json);
        },
        error(err){
          reject(err);
        }
      });
    });

    let p3=new Promise((resolve, reject)=>{
      //resolve       解决->成功
      //reject        拒绝->失败

      $.ajax({
        url: '3.txt',
        dataType: 'json',
        success(json){
          resolve(json);
        },
        error(err){
          reject(err);
        }
      });
    });

    Promise.all([p, p2, p3]).then(arr=>{
      let [j1, a, j2]=arr;

      alert('成功');
      console.log(j1, a, j2);
    }, err=>{
      alert('失败');
    });
    </script>
  </head>
  <body>

  </body>
</html>
